package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserLocationCount;
import com.culturalCenter.dataCenter.mapper.user.UserLocationCountMapper;
import com.culturalCenter.dataCenter.service.user.UserLocationCountService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserLocationCount业务层接口实现类
 * @Date
 *****/
@Service
public class UserLocationCountServiceImpl implements UserLocationCountService {

    @Resource
    private UserLocationCountMapper userLocationCountMapper;

    @Override
    public PageInfo<UserLocationCount> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userLocationCountMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userLocationCountMapper.deleteById(id);
    }

    @Override
    public Integer update(UserLocationCount userLocationCount) {
        return userLocationCountMapper.update(userLocationCount);
    }

    @Override
    public Integer add(UserLocationCount userLocationCount) {
        return userLocationCountMapper.insert(userLocationCount);
    }

    @Override
    public UserLocationCount findById(String id) {
        return userLocationCountMapper.queryById(id);
    }

    @Override
    public List<UserLocationCount> findAll(UserLocationCount userLocationCount) {
        return (List<UserLocationCount>) userLocationCountMapper.queryAll(userLocationCount);
    }

}
